import { rcaNumberFormat,get_month_first,get_date } from './common.js'
import { dateFormat } from '@/util/date'
import { commonTableOption } from './common.js'
export const startDate = get_month_first(0);
export const endDate = get_date(0);
export const tableOption = {
  ...commonTableOption,
  selection: false,
  column: [
    {
      type: 'select',
      label: '线路',
      prop: 'lineCode',
      search: false,
	  searchValue: '9',
	  hide: true,
      // cascaderItem: ['stationCode'],
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: '/support/swparamline/dict',
    },{
      type: 'date',
      label: '日期',
      prop: 'statisticalTime',
      searchSpan: 12,
      searchRange: true,
      search: true,
      searchValue: [startDate, endDate],
      format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
      valueFormat: 'yyyy-MM-dd',
    }, {
      type: 'select',
      label: '票种',
      prop: 'ticketType',
      search: true,
      dicData: [{
        label: "预制单程票",
        value: "预制单程票"
      }, {
        label: "应急纸票",
        value: "应急纸票"
      }, {
        label: "纪念票",
        value: "纪念票"
      }, {
        label: "日票",
        value: "日票"
      }, {
        label: "计次票",
        value: "计次票"
      }],
      //dicUrl: '/rca/swckelectronicreceipt/ticketType',
      /*props: {
        label: 'name',
        value: 'code'
      },*/
    }, {
      type: 'input',
      label: '上月结存数量',
      prop: 'lastDayBalanceQuantity'
    }, {
      type: 'input',
      label: '现库存数',
      prop: 'currentStockQuantity'
    }, {
      type: 'input',
      label: '售卖数量',
      prop: 'soldQuantity'
    }, {
      label: '售卖金额合计',
      prop: 'soldAmount',
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value)
      },
    }, {
      label: '收入统计合计',
      prop: 'incomeAmount',
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value)
      },
    }, {
      label: '差异金额',
      prop: 'differenceAmount',
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value)
      },
      //slot: true
    }, {
    type: 'select',
    label: '差异条件',
    prop: 'diffCondition',
    search: true,
	hide:true,
    dicData: [
       {
        label: '请选择',
        value: ''
      },
	  {
        label: '不等于0',
        value: '1'
      }, {
        label: '等于0',
        value: '0'
      }
    ]
  }]
}
